package com.example.ordersystem.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    /**应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号*/
    public static String app_id = "2021000118677168";

    /**商户私钥，您的PKCS8格式RSA2私钥*/
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCOhd4PqMH4yXyCHCpzeni8u3R3N6Yk1zlcY1RRGScEdq5RuaBPsEtqtzNnwAEp6GyvS7r+2u4nTXsejvpvRSP5tomZbPRCr/UjDFQg2rw6CMvrGBZkphjGcIVBuk88+R7PWt1ASwF+4hGlaOnRKyyaG/0UttW03h2xU9uFffRvdvD0OYz0FzOV/AHqbzhKZ8PXK+YgVtWpV9Uz55DFN0/t7O5oRKK8Y664LCg8m0szRw4Pd0Xcw5aOCxrJ06THu3LvlSkBqz8KtpAKoBocNoyCUIc3Dw8QYol7JAmyyQZJc7pxaBzl/ZiI8/e1tk4pUuka9P1e1w+0PQ17OqgWpvIdAgMBAAECggEABTTKqdPGUio6DB6vRkyhAHPwizJTNWFPTRqrx9KdZEJZl86qFn8gIiPTEuUmpbtBzR19FTY2IOVpq/IZH9tstwB+AkbCnXUEBWW75P9YhN4xZMMafk669PTDSWVe46FOCNEO5/xVb6ceceZlNCjZlj+TfSA4qkS63PFtQXEabr/hfmHfvtmAXWfgz/9rW0xX4zE+FHqP595GuNAVdNMkiaMGfMTeiOT9mn6z03wlpLWjJhMkDajFL68UvpgPolupYxOJWDoMayQNIP+IxZCbajmdZyimDzLi+FJIV4J4A+kbbxLfr3I9VJrLO/4A4fz0KFWWBwQ1ixMpfd4Psk9rwQKBgQDVr67tkh7j3g9X7PNg0UA5CiIfMN5cRxgkQPi3RpAZql4qlO/eZyYjox7n0nc+1lHP3xXDeXxbXMEfiEI9nRCW2BjnGfRT/htggnq1WDeutExFJrfUbpy4+tXGVmYhn5hiG/0VvGo+A9dUIFDGyhM3z5Uq3dY04oR4hsDs5KuRJQKBgQCqvrpNLhSgP+skw4AwJtjtBBhl3oGhHgFke0ts92yuKRWzzrHfu7vi0rhPywagsieEXlTgnje+B/vfs6/2MxVkrKqfLUlZRyfhyRdNjOJRNFlq1HPB0BS2tTYGbkO4I218rABwx2sQN62ooeHoCpMV43Y9X51YpnG7IJSC6IF3mQKBgQC018ILfSZ3Ym9J0lcHERBxNYo7K3iEUAa2Z+YV9bnufqjDENkQN+unLV3yg8Q3gdorOnmIvT/pck5fCUpGKq7nemtY6jZE/0DcJJEE+Gvnht8lhub8+b/ZLS/Oc0BsJE0qetVtl8+yPD34DIFQO6SYDy4G4Udv6mSCPEj6M2yfoQKBgG3+fm/37oupgabmVq8uZ3KQv9LoO2P6u3TqxJVG83liuDtkPUxfWVNu4hNtPDDLdA+e4VjuNAS0ifr7e7DECdUYMrZmaykbYMLgU6W+y5D6g1wBzyydCqsFI++SmweFsyOsfoAox3zkEXhgCPL91PE13lb9QJT6bKva+jE27SiJAoGAcEijnTgLai2SmCbA9le6lSSgjiqkoexG8dglMGW53gutCE8V0i9iwr5p45LW1+g9ENrHYEnt/sVmedmI8tiUzXYt6brfeaPKPCH4k42cFbi6izYI7TXuy6W4uaccG5+IxxUD+jbwboY7V60HNdUca6ZhTXy0Adu28lpDqlHbVdA=";


    /**支付宝公钥*/
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgRtepfn3ugLWITKlxhoVjlBp3OFcFPM58kkwh3lmPNqYl9XBJuLn23ofhqGHiRy2DyaU3lhtN3Q6RhavzDnwWI0BI3RtEXZ9mJZV7g1Ewv3w0GNPNSIbmMVAY/9sjyXu9xFAqT3XUOW+4B4SFNV9ciPRuiJ+hM7CBmQeOsspXcIpI/AgMzIg7OgLfWgTGtvMwjLPd7qEjVvJQSD0SZN4Zi1JWOHBE2njZ9h//uu39telAOY6C/sM7Q4lkN/TnIzSTQjp9CcO6xmBBH1l1dxdrbgh50zIZNC6+kG29pb0DCqAYHApMCXfb4c13rRfk5/KCDxg9Nd31S5GEgvfXRoqxwIDAQAB";

    /**页面跳转同步通知页面路径*/
    public static String return_url = "http://localhost:8080/customer/billPage";

    /**签名方式*/
    public static String sign_type = "RSA2";

    /**字符编码格式*/
    public static String charset = "utf-8";

    /**支付宝网关*/
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    /**支付宝网关*/
    public static String log_path = "C:\\";


    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
